docs: document hooks and JS commands in dead views#4246
Merged
SteffenDE merged 3 commits intoMay 29, 2026
Merged
Conversation
Member
|
As per @josevalim, we don't refer to regular views as dead views. Therefore, I don't think we should make this as prominent. So instead of
rather
and then in the headings just say "regular view" instead of "dead view"? We should also link back to the Phoenix docs (https://hexdocs.pm/phoenix/controllers.html#rendering). |
SteffenDE
reviewed
May 27, 2026
SteffenDE
approved these changes
May 29, 2026
Member
|
🙌 |
SteffenDE
added a commit
that referenced
this pull request
May 29, 2026
* docs: document hooks and JS commands in dead views * docs: address review feedback on regular view section * Update guides/client/js-interop.md --------- Co-authored-by: Steffen Deusch <steffen@deusch.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a dedicated, searchable section to the JavaScript interoperability guide covering how
phx-hook,phx-mounted, and client-sidePhoenix.LiveView.JScommands behave on regular pages that are not LiveViews (dead views).Why
The term dead view is used broadly across the technical surface — in the code, in the CHANGELOG ("Add dead view support for hooks" / "Add dead view support for JS commands", v0.18.0), and commonly in conversation — but it appears nowhere in the docs. That leaves the term, and the capability behind it, unclear to users who encounter it elsewhere and have nothing to search for.
The feature itself (hooks and JS commands outside a LiveView) shipped in v0.18.0 yet was only hinted at by a single one-line note in the hook lifecycle list that never named "dead view" — so it's effectively undiscoverable, by people and AI assistants alike.
Changes
guides/client/js-interop.md, introducing the term dead view (with synonyms — dead render / static page / outside of a LiveView) and splitting behavior into what works vs. what doesn't:phx-hook(mountedonly),phx-mounted,phx-click+ purely client-sideJScommands.JS.navigate/JS.patch: live navigation when a LiveView is present, otherwise a full-page browser navigation fallback.JS.push, form bindings (phx-change,phx-submit),phx-connected/phx-disconnected.phx-mountedandphx-connected/phx-disconnectednotes inguides/client/bindings.md.Docs-only; no code changes.